#ifndef TIMER_H_INCLUDED
#define TIMER_H_INCLUDED

#include "PlatformTarget.h"
#include "Atomic.h"

namespace CEngine
{

///
///A low level timer class.
///
class Timer {
    public:

        Timer(void);

        ~Timer(void);

        void
        startTimer(void);       ///begins timer

        static D64
        getResolution(void);    ///returns the resolution of the timer in cycles per millisecond

        I64
        getTicks(void);         ///returns the number of cycles since the timer was started

        D64
        getTime(void);          ///returns the time (in seconds) since the timer was started

        void
        resetTimer(void);       ///resets the timer

    private:

        static I64
        getRawFrequency(void);     ///returns the raw frequency

        I64 timerStart;
        static I64 frequency;
};

}

#endif // TIMER_H_INCLUDED
